package com.md.service.impl;

import com.md.dao.UserDao;
import com.md.entity.DeptInfo;
import com.md.service.UserService;
import lombok.Data;

import java.util.List;

@Data
public class UserServiceImpl implements UserService {
    private UserDao userDao;
    @Override
    public Boolean removeUserById(int id) {
        int i = userDao.deleteUserById(id);
        return i>0;
    }

    @Override
    public DeptInfo getUserId(int id) {
        DeptInfo deptInfo = userDao.selectUserById(id);
        deptInfo.setDname("财务部");
        return deptInfo;
    }

    @Override
    public List<DeptInfo> selectAllDept() {
        return userDao.selectAllDept();
    }

    @Override
    public boolean insertDept(DeptInfo deptInfo) {
        return userDao.insertUser(deptInfo)>0;
    }


}
